--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<gpx version="1.0" creator="GPSBabel - https://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0">
+ <time>1970-01-01T00:00:00Z</time>
+ <bounds minlat="30.046233000" minlon="-91.599283000" maxlat="30.046783000" maxlon="-91.598467000"/>
+ <trk>
+ <name>LOG-20020527</name>
+ <trkseg>
+ <trkpt lat="30.046233000" lon="-91.598467000">
+ <ele>0.000</ele>
+ <time>2002-05-27T19:02:48.005Z</time>
+ </trkpt>
+ <trkpt lat="30.046317000" lon="-91.598967000">
+ <ele>0.000</ele>
+ <time>2002-05-27T19:03:43.005Z</time>
+ </trkpt>
+ <trkpt lat="30.046783000" lon="-91.599283000">
+ <ele>0.000</ele>
+ <time>2002-05-27T19:04:49.005Z</time>
+ </trkpt>
+ </trkseg>
+ </trk>
+</gpx>
gpsbabel -t -i gpx -f ${REFERENCE}/track/trackfilter.gpx -x track,move=-5m,name=LOG-20020527,start=20020527185742,stop=20020527185950,minimum_points=2 -o gpx -F ${TMPDIR}/trackfilter-move-m.gpx
compare ${REFERENCE}/track/trackfilter-move-m.gpx ${TMPDIR}/trackfilter-move-m.gpx
+gpsbabel -t -i gpx -f ${REFERENCE}/track/trackfilter.gpx -x track,move=5z,name=LOG-20020527,start=20020527190141.5,stop=20020527190449.5,minimum_points=2 -o gpx -F ${TMPDIR}/trackfilter-move-z.gpx
+compare ${REFERENCE}/track/trackfilter-move-z.gpx ${TMPDIR}/trackfilter-move-z.gpx
+
# actually test a merge
gpsbabel -t -i gpx -f ${REFERENCE}/track/trackfilter_merge.gpx -x track,merge -x track,speed -o gpx -F ${TMPDIR}/trackfilter_merge~gpx.gpx
compare ${REFERENCE}/track/trackfilter_merge~gpx.gpx ${TMPDIR}/trackfilter_merge~gpx.gpx
{
qint64 result = 0;
- static const QRegularExpression re(R"(^([+-]?\d+)([wdhms])(?:([+-]?\d+)([wdhms]))?(?:([+-]?\d+)([wdhms]))?(?:([+-]?\d+)([wdhms]))?(?:([+-]?\d+)([wdhms]))?$)", QRegularExpression::CaseInsensitiveOption);
+ static const QRegularExpression re(R"(^([+-]?\d+)([wdhmsz])(?:([+-]?\d+)([wdhmsz]))?(?:([+-]?\d+)([wdhmsz]))?(?:([+-]?\d+)([wdhmsz]))?(?:([+-]?\d+)([wdhmsz]))?(?:([+-]?\d+)([wdhmsz]))?$)", QRegularExpression::CaseInsensitiveOption);
assert(re.isValid());
QRegularExpressionMatch match = re.match(arg);
if (match.hasMatch()) {
switch (match.captured(idx+1).at(0).toLower().toLatin1()) {
case 'w':
- partial *= SECONDS_PER_DAY * 7;
+ partial *= SECONDS_PER_DAY * 1000 * 7;
break;
case 'd':
- partial *= SECONDS_PER_DAY;
+ partial *= SECONDS_PER_DAY * 1000;
break;
case 'h':
- partial *= SECONDS_PER_HOUR;
+ partial *= SECONDS_PER_HOUR * 1000;
break;
case 'm':
- partial *= 60;
+ partial *= 60 * 1000;
break;
case 's':
+ partial *= 1000;
+ break;
+ case 'z':
break;
default:
fatal(MYNAME "-time: invalid unit in move option \"%s\"!\n", qPrintable(match.captured(idx+1)));
}
#ifdef TRACKF_DBG
- qDebug() << MYNAME "-time option: shift =" << result << "seconds";
+ qDebug() << MYNAME "-time option: shift =" << result / 1000.0 << "seconds";
#endif
} else {
fatal(MYNAME "-time: invalid value in move option \"%s\"!\n", arg);
for (auto* track : qAsConst(track_list)) {
foreach (Waypoint* wpt, track->waypoint_list) {
if (wpt->creation_time.isValid()) {
- wpt->creation_time = wpt->creation_time.addSecs(delta);
+ wpt->creation_time = wpt->creation_time.addMSecs(delta);
} else {
++timeless_points;
}
The value of this option is a series of integer and unit pairs. Each integer may include a
leading '+' or '-' sign. Positive integers shift the tracks later, while negative integers shift
the tracks earlier. If no sign is provided the integer is assumed to be nonnegative.
-Possible units are w for weeks, d for days, h for hours, m for minutes and s for seconds.
+Possible units are w for weeks, d for days, h for hours, m for minutes, s for seconds and z for milliseconds.
</para>
<example xml:id="ex_track_move">
<title>Time-shifting a track with the track filter</title>